package org.hegang.design.first.factorypattern;

import org.hegang.design.common.CommonFields;

/**
 * @ClassName FactoryPatternMain
 * @Describe: 工厂模式
 * @Author: gang.he
 * @Date: Created in 22:58 2019/6/27
 * Modified By:
 * Version V1.0
 */
public class FactoryPatternMain {
    public static void main(String[] args) {

        ShapeFactory shapeFactory = new ShapeFactory();

        Shape shapeOne = shapeFactory.getShape(CommonFields.RECTANGLE);
        shapeOne.draw();

        Shape shapeTwo = shapeFactory.getShape(CommonFields.SQUARE);
        shapeTwo.draw();

        Shape shapeThree = shapeFactory.getShape(CommonFields.CIRCLE);
        shapeThree.draw();
    }
}
